package com.zzq.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zzq.domain.dto.SmileAlbumDTO;
import com.zzq.domain.entity.SmileAlbum;
import com.zzq.domain.search.AlbumSearchParamet;
import com.zzq.mapper.SmileAlbumMapper;
import com.zzq.service.SmileAlbumService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 谢文宗
 * @since 2023-08-22
 */
@Service
public class SmileAlbumServiceImpl extends ServiceImpl<SmileAlbumMapper, SmileAlbum> implements SmileAlbumService {

    @Autowired
    SmileAlbumMapper smileAlbumMapper;
    @Override
    public List<SmileAlbumDTO> albumDTOList(AlbumSearchParamet searchParamet) {
        return smileAlbumMapper.albumDTOList(searchParamet);
    }

    @Override
    public Integer getAlbumNum(String clientNo) {
        LambdaQueryWrapper<SmileAlbum> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.eq(SmileAlbum::getClientNo,clientNo);
        return smileAlbumMapper.selectCount(queryWrapper);
    }
}
